/*
ID: quxiao82
LANG: C++
PROG: contact
*/


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std ;

const int MAX = 200000;
struct Pattern
{
       string content;
       int num;
};

//char str[MAX+1];
int a, b, n;
string str;
map<string, int > cnt ;
map<string, int >::iterator it ;
vector<Pattern> ans;

bool operator <(Pattern p1 , Pattern p2 )
{
       if ( p1. num != p2. num )
             return p1.num > p2.num;
       if ( p1. content. length() != p2. content. length() )
             return p1.content.length() < p2.content.length();
       return p1.content < p2.content;
}

void Input ()
{
       int tmp = 0;
       char s[100];
       scanf( "%d%d%d", &a, &b, &n);
       while ( scanf("%s" , s ) != EOF )
      {
             //tmp = strlen(str);
             str += s;
      }
       //printf("%s\n", str);
}

void Output ()
{
       int i, tmpNum, lastF, fNum;
       tmpNum = 0;
       lastF = -1;
       fNum = 0;
       for ( i = 0; i < ans. size(); i ++)
      {
             if ( ans[ i]. num != lastF )
            {
                   if ( fNum++ == n )
                         break;
                   lastF = ans[ i]. num;
                   tmpNum = 0;
                   if ( i != 0 )
                         cout<< endl;
                   cout<< ans[ i]. num;
            }
             if ( tmpNum != 0 )
                   cout<< ' ';
             else
                   cout<< endl;
             cout<< ans[ i]. content;
             if ( ++ tmpNum == 6 )
                   tmpNum = 0;
      }
       cout<< endl;
}

void Solve ()
{
       int i, j, len;
       char sub[13];
       Pattern p;
       len = str. length();
       for ( i = a; i <= b; i ++)
      {
             for ( j = 0; j < len- i+1; j ++)
            {
                   cnt[ str. substr( j, i)] ++;
            }
      }
       i = 0;
       for ( it = cnt. begin(); it != cnt. end(); ++ it)
      {
             p. content = it-> first;
             p. num = it-> second;
             ans. push_back( p);
      }
       sort( ans. begin(), ans. end());
//    for (i = 0; i < ans.size(); i ++)
//    {
//          cout<<ans[i].content<<' '<<ans[i].num<<endl;
//    }
       Output();
}

int main ()
{
       freopen( "contact.in", "r" , stdin );
       freopen( "contact.out", "w" , stdout );

       Input();
       Solve();

       return 0;
}
